package com.hutra.utils 
{
	import com.greensock.TweenMax;
	import flash.display.DisplayObject;
	import flash.filters.GlowFilter;
	/**
	 * ...
	 * @author ...
	 */
	public class Highlight {
		protected var object:DisplayObject;
		public static const HIGHLIGHTED:Number = 0;	// Border for object
        public static const SELECTED:Number = 1;	// Border for object
        public static const DESELECTED:Number = -1; // Border for object
		public static const GLOW:Number = 2;		//
		public static const FRIEND:Number = 3;		//
		
		private static const COLOR_HIGHLIGHT:uint 	= 16755200;
		private static const COLOR_GLOW:uint 	 	= 16777215;
		private static const COLOR_FRIEND:uint		= 0xffffff;
		private static const COLOR_SELECTED:uint  	= 16755200;
		
		protected var highlightType:Number = -1;  	// Border for object
		private var ishighlighted:Boolean = false;//
		
		public function Highlight(value:*) {
			object = value;
		}
		
		public function setHighlighted(value:Number) : void {
			if (object == null) return;
            highlightType = value;
            if (value == HIGHLIGHTED)
            {
                object.filters = [];
                object.filters = [new GlowFilter(COLOR_HIGHLIGHT, 1, 8, 8, 20)];
                ishighlighted = true;
            }
            else if (value == GLOW)
            {
                object.filters = [];
                object.filters = [new GlowFilter(COLOR_GLOW, 1, 8, 8, 10)];
                ishighlighted = true;
            }
			else if (value == FRIEND)
            {
                object.filters = [];
                object.filters = [new GlowFilter(COLOR_FRIEND, 1, 8, 8, 10)];
                ishighlighted = true;
            }
            else if (value == SELECTED)
            {
                object.filters = [];
                object.filters = [new GlowFilter(COLOR_SELECTED, 1, 8, 8, 20)];
                ishighlighted = true;
            }
            else
            {
                object.filters = [];
                ishighlighted = false;
            }
        }
		public function set setIshighlighted(value:Boolean):void{this.ishighlighted = value; }
		public function get getIshighlighted():Boolean{ return this.ishighlighted;}

	}

}